<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>${_title}</title>

    <!-- Bootstrap core CSS -->

    <link href="${_css}/bootstrap.min.css" rel="stylesheet">

    <link href="${_font}/css/font-awesome.min.css" rel="stylesheet">
    <link href="${_css}/animate.min.css" rel="stylesheet">

    <!-- Custom styling plus plugins -->
    <link href="${_css}/custom.css" rel="stylesheet">
    <link href="${_css}/icheck/flat/green.css" rel="stylesheet">
    <link href="${_css}/datatables/tools/css/dataTables.tableTools.css" rel="stylesheet">
	<link rel="stylesheet" href="${_css}/base.css">
    <script src="${_js}/jquery.min.js"></script>
	<script src="${_js}/resize.js"></script>
	<script type="text/javascript" src="${_front_js}/jquery.page.js"></script>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
	<style>
		td a{
			cursor:pointer
		}
	</style>
</head>

<body style="background: #F7F7F7;">
<div class="">
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
	            <div class="x_title">
					<h2>用户资金总览信息</h2>
					<div class="clearfix"></div>
				</div>
                <div class="pull-right">
                	<button id="query" type="button" class="btn btn-info">查询</button>
                	<button id="export" type="button" class="btn btn-primary export">导出</button>
                </div>
                <form class="form-horizontal form-label-left input_mask">
                    <div class="col-md-2 col-sm-2 col-xs-6 form-group has-feedback">
                        <input type="text" class="form-control has-feedback-left" id="username" value="<#if username?exists>${username}</#if>"
                        placeholder="输入用户名">
                        <span class="fa fa-user form-control-feedback left" aria-hidden="true"></span>
                    </div>
                    <div class="col-md-2 col-sm-2 col-xs-5 form-group has-feedback">
                        <select class="form-control" id="match" >
                        	<option value="-1">--请选择匹配符--</option>
							<option value="GT" <#if match?exists & match=='GT'>selected="selected"</#if>>大于</option>
							<option value="LT" <#if match?exists & match=='LT'>selected="selected"</#if>>小于</option>
							<option value="GE" <#if match?exists & match=='GE'>selected="selected"</#if>>大于等于</option>
							<option value="LE" <#if match?exists & match=='LE'>selected="selected"</#if>>小于等于</option>
							<option value="NE" <#if match?exists & match=='NE'>selected="selected"</#if>>不等于</option>
							<option value="EQ" <#if match?exists & match=='EQ'>selected="selected"</#if>>等于</option>
						</select>
                    </div>
                    <div class="col-md-2 col-sm-2 col-xs-6 form-group has-feedback">
                        <input type="text" class="form-control has-feedback-left" id="amount" 
                        onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"
                        value="<#if amount?exists>${amount}</#if>"
                        placeholder="输入总金额">
                        <span class="fa fa-user form-control-feedback left" aria-hidden="true"></span>
                    </div>
                 </form>
                <div class="clearfix"></div>
            </div>
            <div class="scroll">
                <div class="x_content">
                    <table id="example" data-action="/admin/userAccount/list?1=1" class="table table-striped responsive-utilities jambo_table">
                        <thead>
                            <tr class="headings">
                                <th>
                                    <input type="checkbox" class="tableflat">
                                </th>
                                <th>序号 </th>
                                <th>用户名</th>
                                <th>用户电话</th>
                                <th>真实姓名</th>
                                <th>等级</th>
                                <th>总金额(￥)</th>
                                <th>总收入(￥)</th>
                                <th>总支出 (￥)</th>
                                <th>可用余额(￥)</th>
                                <th>冻结金额(￥)</th>
                                <th>待收金额(￥)</th>
                                <th>待还金额(￥)</th>
                                <th>总充值(￥)</th>
                                <th>总提现(￥)</th>
                                <th>用户积分</th>
                            </tr>
                        </thead>

                        <tbody>
			                <#if (pageInfo.pageList?size > 0)>
								<#list pageInfo.pageList as item>
									<tr class="even pointer">
		                                <td class="a-center ">
		                                    <input type="checkbox" class="tableflat">
		                                </td>
		                                <td>
		                                	${item_index+1}
		                                </td>
		                                <td>
		                                	<#if item.username?exists>
			                                	${item.username}
		                                	</#if>
		                                </td>
		                                <td>
		                                	<#if item.phone?exists>
			                                	${item.phone}
		                                	</#if>
		                                </td>	
		                               	<td>
		                               		<#if item.realname?exists>
			                                	${item.realname}
		                                	</#if>
		                                </td>    
		                                <td>
		                                	<!--<#if item.level??>
		                                		<#if item.level == 1>
		                                			普通会员
		                                		<#elseif item.level == 2>
		                                			银牌会员
		                                		<#elseif item.level == 3>
		                                			金牌会员
		                                		<#elseif item.level == 4>
		                                			白金会员
		                                		</#if>
		                                	</#if>-->
		                                	<#if item.levelName?exists && item.levelName != "">
		                                		${item.levelName}
		                                	</#if>
		                                </td>	 
		                                <td>
		                                	<#if item.totalAmount?exists>
		                                		<#if (item.totalAmount != 0 )>
			                                		${item.totalAmount?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
		                                </td>                           
		                                <td>
		                                	<#if item.totalIncome?exists>
		                                		<#if (item.totalIncome != 0 )>
			                                		${item.totalIncome?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
		                                </td>		
		                                <td>
		                                	<#if item.totalExpenses?exists>
		                                		<#if (item.totalExpenses != 0 )>
			                                		${item.totalExpenses?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
		                                </td>
		                                <td style="color:#46b8da">
		                                	<#if item.balance?exists>
		                                		<#if (item.balance != 0 )>
			                                		${item.balance?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
		                                </td>
		                                <td style="color:red">
		                                	<#if item.freezen?exists>
		                                		<#if (item.freezen != 0 )>
			                                		${item.freezen?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
		                                </td>
		                                <td>
		                                	<#if item.await?exists>
		                                		<#if (item.await != 0 )>
			                                		${item.await?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
		                                </td>
		                                <td>
		                                	<#if item.repay?exists>
		                                		<#if (item.repay != 0 )>
			                                		${item.repay?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
		                                </td>
		                                <td>
		                                	<#if item.totalRecharge?exists>
		                                		<#if (item.totalRecharge != 0 )>
			                                		${item.totalRecharge?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
		                                </td>
		                                <td>
		                                	<#if item.totalWithdraw?exists>
		                                		<#if (item.totalWithdraw != 0 )>
			                                		${item.totalWithdraw?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
		                                </td>
		                                <td>
		                                	<#if item.score?exists>
			                                	${item.score}
		                                	</#if>
		                                </td>
		                             </tr>   
		                        </#list>
		                    <#else>
								<tr class="even pointer">
									<td colspan="15">无记录</td>
								</tr>
							</#if>
                        </tbody>
                    </table>
                    <#if (pageInfo.pageList?size > 0)>
	                	<#include "../base/Page.ftl">
	                </#if>
                </div>
            </div>
        </div>
        <br />
    </div>
</div>
                    

<script src="${_js}/bootstrap.min.js"></script>

<!-- bootstrap progress js -->
<script src="${_js}/progressbar/bootstrap-progressbar.min.js" type="text/javascript"></script>
<script src="${_js}/nicescroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<!-- icheck -->
<script src="${_js}/icheck/icheck.min.js" type="text/javascript"></script>
<script src="${_js}/custom.js" type="text/javascript"></script>

<!-- PNotify -->
<script src="${_js}/notify/pnotify.core.js" type="text/javascript"></script>
<script src="${_js}/notify/pnotify.buttons.js" type="text/javascript"></script>
<script src="${_js}/notify/pnotify.nonblock.js" type="text/javascript" ></script>
<script type="text/javascript">
	//查询
	$("").click(function(){
		
	})

    $(document).ready(function(){
        $('input.tableflat').iCheck({
            checkboxClass: 'icheckbox_flat-green',
            radioClass: 'iradio_flat-green'
        });
    });
    
    function initData(action) { 
    	var username= $.trim($("#username").val());
    	var match = $.trim($("#match").find("option:selected").val());
    	var amount = $.trim($("#amount").val());
    	if(username !=""){
    		action += "&username="+username;
    	}
    	if(match != -1){
    		action += "&match="+match;
    	}
    	if(amount !=""){
    		if(match == -1){
    			new PNotify({
		            	title: '操作提示',
		            	text: '请先选择匹配符！',
		            	delay: 3e3,
		            	type: 'error'
		        	});  
		        return;
    		}
    		action += "&amount="+amount;
    	}
		window.location.href=encodeURI(encodeURI(action));

	} 
	
	$(".btn-info").click(function(){
		initData($("#example").attr('data-action'));
	});
	
	
	$("#export").click(function(){
	    var action ="/admin/export/userAccount";
		var username= $.trim($("#username").val());
    	var match = $.trim($("#match").find("option:selected").val());
    	var amount = $.trim($("#amount").val());
    	if(username !=""){
    		action += "&username="+username;
    	}
    	if(match != -1){
    		action += "&match="+match;
    	}
    	if(amount !=""){
    		if(match == -1){
    			new PNotify({
		            	title: '操作提示',
		            	text: '请先选择匹配符！',
		            	delay: 3e3,
		            	type: 'error'
		        	});  
		        return;
    		}
    		action += "&amount="+amount;
    	}
		window.location.href=encodeURI(encodeURI(action));
});	
	
</script>
</body>

</html>